﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project2.容器
{
    internal class QueueStudy
    {
        private static void MainQueueStudy(string[] args)
        {
            Queue queue = new Queue();

            for (int i = 0; i < 10; i++)
            {
                queue.Enqueue(i);
            }
            PrintQueue(queue);
            Console.WriteLine(queue.Dequeue());
            Console.WriteLine(queue.Dequeue());
            Console.WriteLine(queue.Dequeue());
            PrintQueue(queue);
            Console.WriteLine(queue.Peek());

            Console.WriteLine();
        }

        private static void PrintQueue(Queue queue)
        {
            foreach (var item in queue)
            {
                Console.WriteLine(item);
            }
        }
    }
}